home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Misc / HYPERBOOK2.DMS / in.adf / Macros / Bevel{obj} next >
Encoding:
Text File  |  1990-09-24  |  840 b   |  37 lines

  1. /* Bevel (obj)
  2.  
  3.    Bevel the given object (arg1) by surrounding it with two buttons having
  4.    the same border and shadow colors. Create a group containing the object
  5.    and the buttons. This is suitable only for objects with the embossed
  6.    shadow style, not those with drop-shadows.
  7. */
  8.  
  9. call interactive(0)
  10.  
  11. ob = arg(1)
  12. pg = getpage(ob)
  13. bd = getborder(ob)
  14. sh = getshadow(ob)
  15.  
  16. left   = getleft(ob)
  17. top    = gettop(ob)
  18. width  = getwidth(ob)
  19. height = getheight(ob)
  20.  
  21. do i = 1 to 2
  22.    b = relocate(createbutton(),pg)
  23.    call setbackground(b,-1)
  24.    call setborder(b,bd)
  25.    call setshadow(b,sh)
  26.    call shadowstyle(b,2)
  27.    call scaletosize(b, width + 4 * i, height + 2 * i)
  28.    call setposition(b, left - 2 * i, top - i)
  29.    btn.i = b
  30.    end
  31.  
  32. g = creategroup()
  33. call relocate(btn.2,g)
  34. call relocate(btn.1,g)
  35. call relocate(ob,g)
  36. call relocate(g,':')
  37.